home *** CD-ROM | disk | FTP | other *** search
/ Digital Photo Book 16: Sister 7 / Digital Photo Book 16: Sister 7.iso / mac / DATA / main.dir / 00007_Script_ÉÄÅ[ÉrÅ[ÉXÉNÉäÉvÉg < prev    next >
Text File  |  2004-11-21  |  778b  |  39 lines

  1. global photo_max
  2. global photo_start_no
  3. global config
  4.  
  5. on startmovie  
  6.   load_config
  7.   
  8.   photo_start_no = config["PHOTO_START"]
  9.   if voidP(photo_start_no) then
  10.     photo_start_no = 4
  11.   end if
  12.   
  13.   photo_max = findEmpty(member( 1,"DATA")) - photo_start_no  
  14. end
  15.  
  16. on photo_get(n)
  17.   if n < 0 then 
  18.     n = n + photo_max
  19.   else if n >= photo_max then
  20.     n = n - photo_max
  21.   end if
  22.   return member( n + photo_start_no,"DATA")
  23. end
  24.  
  25. on load_config
  26.   config = [:]
  27.   t = member("CONFIG").text
  28.   
  29.   org_delimiter = the itemdelimiter
  30.   the itemdelimiter = "="
  31.   repeat with i = 1 to t.line.count
  32.     itemname = t.line[i].item[1]
  33.     itemvalue = t.line[i].item[2]
  34.     config[itemname] = itemvalue
  35.   end repeat
  36.   the itemdelimiter = org_delimiter
  37. end
  38.  
  39.